package com.sss.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.servlet.http.HttpSession;

public class BaseController {
    protected Logger logger= LogManager.getLogger(LogManager.ROOT_LOGGER_NAME);

    protected  Object checkAdmin(HttpSession session){
        Object o=session.getAttribute("adminId");
        if (o==null){
            logger.info("无管理员权限，返回管理员登录页面");
            return  null;
        }
        logger.info("权限验证成功，管理员ID：{}",o);
        return o;
    }
}
